projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2e0a45
)
designware_i2c: disable i2c controller during target address setup
author
Alexey Brodkin
<
[email protected]
>
Thu, 7 Nov 2013 13:52:18 +0000
(17:52 +0400)
committer
Heiko Schocher
<
[email protected]
>
Wed, 13 Nov 2013 05:22:06 +0000
(06:22 +0100)
As it is stated in DesignWare I2C databook: writes to IC_TAR (0x4)
register succeed only when IC_ENABLE[0] is set to 0.
Signed-off-by: Alexey Brodkin <
[email protected]
>
Cc: Tom Rini <
[email protected]
>
cc: Armando Visconti <
[email protected]
>
Cc: Stefan Roese <
[email protected]
>
Cc: Albert ARIBAUD <
[email protected]
>
Cc: Heiko Schocher <
[email protected]
>
Cc: Vipin KUMAR <
[email protected]
>
Cc: Tom Rix <
[email protected]
>
Cc: Mischa Jonker <
[email protected]
>
drivers/i2c/designware_i2c.c
patch
|
blob
|
history
diff --git
a/drivers/i2c/designware_i2c.c
b/drivers/i2c/designware_i2c.c
index c2f06627d3e312b52a24c6310927a317d4dd506d..c5c6015e99555c80621856428eee863388bb0c8e 100644
(file)
--- a/
drivers/i2c/designware_i2c.c
+++ b/
drivers/i2c/designware_i2c.c
@@
-151,7
+151,19
@@
void i2c_init(int speed, int slaveadd)
*/
static void i2c_setaddress(unsigned int i2c_addr)
{
+ unsigned int enbl;
+
+ /* Disable i2c */
+ enbl = readl(&i2c_regs_p->ic_enable);
+ enbl &= ~IC_ENABLE_0B;
+ writel(enbl, &i2c_regs_p->ic_enable);
+
writel(i2c_addr, &i2c_regs_p->ic_tar);
+
+ /* Enable i2c */
+ enbl = readl(&i2c_regs_p->ic_enable);
+ enbl |= IC_ENABLE_0B;
+ writel(enbl, &i2c_regs_p->ic_enable);
}
/*